package com.example.a10928.weifriend.ui;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.Nullable;

public abstract class DatabindingBaseActivity extends BaseActivity {

    private ViewDataBinding viewDataBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewDataBinding = DataBindingUtil.setContentView(this, getContentView());
        bindingInitData();
        bindingInitView(viewDataBinding);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {

    }

    @Override
    public int getContentView() {
        return bindingGetContentView();
    }



    protected abstract void bindingInitData();
    protected abstract void bindingInitView(ViewDataBinding viewDataBinding);
    protected abstract int bindingGetContentView();
}
